Arrows are more fun
authorjustbur <justin@burkett.cc>
Fri, 3 Jul 2015 16:00:07 +0000 (12:00 -0400)
committerjustbur <justin@burkett.cc>
Fri, 3 Jul 2015 16:42:03 +0000 (12:42 -0400)
Also add padding between entries

which-key.el

index 4bb33922526f27b6797f271f0d6eccc59cb40432..54831b528293c18aabd8580cfaef96b94ef6648f 100644 (file)
@@ -91,13 +91,14 @@ length."
             (prefix (string-match-p "^Prefix" desc))
             (desc-face (if (or prefix group)
                            'font-lock-keyword-face 'font-lock-function-name-face))
+            (sign (if (or prefix group) "▶" "→"))
             (tmp-desc (which-key/truncate-description (if group (substring desc 6) desc)))
             (key-padding (s-repeat (- max-len-key (length key)) " "))
             (padded-desc (s-pad-right max-len-desc " " tmp-desc)))
-       (format (concat (propertize "[" 'face 'font-lock-comment-face) "%s"
-                       (propertize "]" 'face 'font-lock-comment-face) "%s"
+       (format (concat (propertize "%s%s" 'face 'font-lock-constant-face) " "
+                       (propertize sign 'face 'font-lock-comment-face)
                        (propertize " %s" 'face desc-face))
-               key key-padding padded-desc)))
+               key-padding key padded-desc)))
    unformatted))
 
 (defun which-key/replace-strings-from-alist (replacements)
@@ -174,6 +175,7 @@ Finally, show the buffer."
               (setq max-len-desc (if (> max-len-desc which-key-max-description-length)
                                      (+ 2 which-key-max-description-length) ; for the ..
                                    max-len-desc)
+                    max-len-desc (1+ max-len-desc) ; pad with one character
                     formatted (which-key/format-matches
                                unformatted max-len-key max-len-desc)))
             (with-current-buffer (get-buffer which-key--buffer)